package org.example.factory.routine;

import org.example.factory.service.Action;

public class Test2 {
    public static void main(String[] args) {
        // 使用不同工厂创建不同动作
        ActionFactory singFactory = new SingActionFactory();
        Action sing = singFactory.createAction();
        sing.doAction();  // 输出：我在唱歌...

        ActionFactory jumpFactory = new JumpActionFactory();
        Action jump = jumpFactory.createAction();
        jump.doAction();  // 输出：我在跳高...

        ActionFactory runFactory = new RunActionFactory();
        Action run = runFactory.createAction();
        run.doAction();   // 输出：我在跑步...
    }
}
